package com.hpeng.sys.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class SysSubModulePK implements Serializable {
	private static final long serialVersionUID = 1L;
	private String moduleId;
	private String subModuleId;

	public SysSubModulePK() {
	}

	public SysSubModulePK(String moduleId, String subModuleId) {
		this.moduleId = moduleId;
		this.subModuleId = subModuleId;
	}

	@Column(name = "MODULE_ID")
	public String getModuleId() {
		return moduleId;
	}

	public void setModuleId(String moduleId) {
		this.moduleId = moduleId;
	}

	@Column(name = "SUB_MODULE_ID")
	public String getSubModuleId() {
		return subModuleId;
	}

	public void setSubModuleId(String subModuleId) {
		this.subModuleId = subModuleId;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((moduleId == null) ? 0 : moduleId.hashCode());
		result = prime * result
				+ ((subModuleId == null) ? 0 : subModuleId.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		SysSubModulePK other = (SysSubModulePK) obj;
		if (moduleId == null) {
			if (other.moduleId != null)
				return false;
		} else if (!moduleId.equals(other.moduleId))
			return false;
		if (subModuleId == null) {
			if (other.subModuleId != null)
				return false;
		} else if (!subModuleId.equals(other.subModuleId))
			return false;
		return true;
	}

}